package cn.mumzone.pos.util;

import android.content.Context;
import android.util.AttributeSet;

import com.google.android.flexbox.FlexWrap;
import com.google.android.flexbox.FlexboxLayoutManager;

/**
 * Created by qiuzhenhuan on 2019/8/27.
 */

public class MyFlexBoxLayoutManager extends FlexboxLayoutManager {

    public MyFlexBoxLayoutManager(Context context) {
        super(context);
    }


    @Override
    public boolean canScrollHorizontally() {
        if(!isAttachedToWindow()){
            return false;
        }
        if (super.getFlexWrap() == FlexWrap.NOWRAP) {
            return isMainAxisDirectionHorizontal();
        } else {
            return super.canScrollHorizontally();
        }
    }
}